home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
comms
/
html-heaven
/
arexx
/
html-ced.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-01-08
|
2KB
|
84 lines
/***
** HTML.rexx
**
** $VER: HTML.rexx 2.2. (8 January 1996)
**
** This script inserts HTML-Heaven codes into the CED document. If no
** block is currently defined, the skeleton code is inserted. If a block
** IS defined, though, this script will sandwhich the block between the
** HTML codes.
**
** This script requires CygnusEd Professional v3.5 (or later) to run as
** well as HTML-Heaven.
**
** Copyright 1995 By Paul Kolenbrander (paul@serena.iaehv.nl)
*/
OPTIONS RESULTS
PARSE ARG MYCMD HTMLCMD
ADDRESS 'rexx_ced'
HTMLCMD = SUBSTR(HTMLCMD, 2, LENGTH(HTMLCMD) - 1) /* rem leading ' ' */
HTMLCMD = SUBSTR(HTMLCMD, 2, LENGTH(HTMLCMD) - 2)
IF POS('><',HTMLCMD) ~= 0 THEN DO /* Is it a split command? */
STATUS BLOCKY
IF (RESULT = -1) THEN DO
CEDTOFRONT
TEXT HTMLCMD
END
ELSE DO
CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
STATUS CLIPUNIT
OldClipUnit = Result
SET CLIPBOARD UNIT OldClipUnit + 1
CEDTOFRONT
CUT
IF (RESULT ~= 1) THEN DO
CEDTOFRONT
OKAY1 "Error while deleting block"
END
TEXT CMD1
PASTE
TEXT CMD2
SET CLIPBOARD UNIT OldClipUnit
END
END
ELSE DO
CEDTOFRONT
TEXT HTMLCMD
END
IF MYCMD = 'SAVE' THEN DO
SAVE
STATUS FILENAME
MYFILE = RESULT
IF RESULT = -1 THEN DO
ADDRESS COMMAND 'rx S:HTMLVIEW.rexx'
END
ELSE DO
IF OPEN('tempname', 'T:TempRexxFile', 'READ') ~= 1 THEN DO
OPEN('tempname','T:TempRexxFile','WRITE')
WRITELN('tempname',MYFILE)
CLOSE('tempname')
ADDRESS COMMAND 'rx S:HTMLVIEW.rexx '||MYFILE
END
ELSE DO
OLDFILE = READLN('tempname')
IF UPPER(OLDFILE) = UPPER(MYFILE) THEN DO
ADDRESS COMMAND 'rx S:HTMLVIEW.rexx'
END
ELSE DO
OPEN('tempname','T:TempRexxFile','WRITE')
WRITELN('tempname',MYFILE)
CLOSE('tempname')
ADDRESS COMMAND 'rx S:HTMLVIEW.rexx '||MYFILE
END
END
END
END
EXIT 0